var mongoose=require('mongoose');
var GuestPrePlanSchema=new mongoose.Schema(
	{
		guestname:{
			type:String,
		},
		mobile:{
			type:String,
		},
		prePlanname:{
			type:String
		},
		prePlanMotions:[{
			motionname:String,
			motionZu:Number,
			motionNumber:Number,
			motionVolecity:Number,
			motionForce:Number,
			restTime:Number,
			motionBeat:Number
		}]
	});
	

GuestPrePlanSchema.pre('save',function(next){
	console.log('保存成功');
	next();
});

GuestPrePlanSchema.statics={
	fetch:function(cb){
		return this.find({}).sort('').exec(cb);
	},
	findById:function(id,cb){
		return this.find({_id:id}).sort('').exec(cb);
	}
}

module.exports=GuestPrePlanSchema;